﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VINETLIFE.BL;
using VINETLIFE.DO;
using System.Data;

namespace VINETLIFE.Module
{
    public partial class ucChildCategory : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
                {
                    int productCategoryID = int.Parse(Request.QueryString["ID"]);
                    if (!IsPostBack)
                    {
                        ltrCategoryParent.Text = new cmsProductCategoryBL().Select(new cmsProductCategoryDO() { ProductCategoryID = productCategoryID }).ProductCategoryTitle;
                        rpListChlidProductCategoryDataSource(productCategoryID);
                    }
                }
            }
        }
        protected void rpListChlidProductCategoryDataSource(int parentCategory)
        {
            rpListChlidProductCategory.DataSource =new DataView(new cmsProductCategoryBL().SelectAll(),"ParentID = " + parentCategory,"",DataViewRowState.CurrentRows);
            rpListChlidProductCategory.DataBind();
        }
        public string FriendlyUrl(string s)
        {
            return Ultility.Change_AV(s);
        }
    }
}